package protect

func Run(try func(), catch func(err interface{}), final ...func()) {
	defer func() {
		if err := recover(); err != nil {
			catch(err)
		}
		for i := range final {
			final[i]()
		}
	}()
	try()
}
